package com.java.example.ui.fragment

import android.content.Intent
import android.os.Bundle
import android.view.View
import androidx.fragment.app.viewModels
import com.java.example.R
import com.java.example.base.BaseFragment
import com.java.example.databinding.FragmentPersonCenterBinding
import com.java.example.ui.activity.LoginActivity
import com.java.example.ui.viewmodel.PersonCenterVewModel


class PersonCenterFragment : BaseFragment<FragmentPersonCenterBinding>(R.layout.fragment_person_center) {
    val viewModel: PersonCenterVewModel by viewModels()
    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        viewModel.binding = this.binding
        binding.viewModel = this.viewModel
        binding.click = Clickable()
        binding.lifecycleOwner = this
    }

    inner class Clickable {
        fun toInfo() {
            startActivity(Intent(requireContext(), LoginActivity::class.java))
        }
    }
}